package com.tony.spring.mode.proxy;

public class DemoTest {
	
	public static void main(String[] args) {
		// 1、创建被代理对象
		DemoService demoService = new DemoServiceImpl();
		
		// 2、创建代理的对象
		DemoServiceProxy demoServiceProxy = new DemoServiceProxy(demoService);
		
		// 3、获取代理对象
		DemoService service = (DemoService) demoServiceProxy.getProxy();
		
		System.out.println(service.demo("cool"));
//		DemoService demoService = new DemoServiceImpl();
//		
//		DemoService demoService2 = new DemoServiceStaticProxy(demoService); 
//	
//		demoService2.demo();
	}

}
